/**
 * This Class will implement the user of our system.
 * Every instance of this class will be a user in our system.
 * 
 * @author Gil Levinson
 * @author Boris Fradlis
 * @author Yogev Levi
 * @author Hila Porat 
 * 
 */
package vcpClasses;

// Imports *************************************

import java.io.Serializable;
import java.util.Vector;

// Start of User *************************** 

@SuppressWarnings("serial")
public class User implements Serializable{

// Class variables ****************************
	
	private Vector<Notification> unreadNotif;
	private String userName = "";
	private String userPassword= "";
	private String userEmailAddress = "";
	private String userFirstName = "";
	private String userLastName = "";
	//private String userLoggedIn ="";
	private int privilege = NEW;
	
	public static final int ADMIN = 0, NET_MANAGER = 1, LOT_MANAGER = 2, LOT_WORKER = 3, CUST_SER_WORKER = 4, CLIENT = 5, NEW = 6;
	
// Constructors **********************************
	
	/**
	 * This constructor will initiate new blank instance of User
	 */
	public User(){
		this.userName = new String();
		this.userPassword = new String();
		this.userEmailAddress = new String();
		this.userFirstName = new String();
		this.userLastName = new String();
		this.privilege = NEW;
	}
	/**
	 * This constructor will initiate new instance of User
	 * @param n - name
	 * @param p - password
	 * @param e - email
	 * @param fn - first name
	 * @param ln - last name
	 * @param priv - privilege in system
	 */
	
	public User(String n,String p, String e, String fn, String ln,int priv){
		this.setUserName(n);
		this.setUserPassword(p);
		this.setUserEmailAddress(e);
		this.setUserFirstName(fn);
		this.setUserLastName(ln);
		this.setPrivilege(priv);		
	}
	/**
	 * this constructor will initiate new user instance to check agianst the DB
	 * @param n - user name
	 * @param p - password
	 */
	
	public User(String n,String p)
	{
		this.setUserName(n);
		this.setUserPassword(p);
		
	}
	/**
	 * This constructor will initiate a copy of a sent user
	 * @param user - other instance of user
	 */
	public User(User user){
		this.setUserName(user.getUserName());
		this.setUserPassword(user.getUserPassword());
		this.setUserEmailAddress(user.getUserEmailAddress());
		this.setUserFirstName(user.getUserFirstName());
		this.setUserLastName(user.getUserLastName());
		this.setPrivilege(user.getPrivilege());
	}
	
	
	// Getters and Setters *********************************************	
	
	/**
	 * @return the userName
	 */
	public String getUserName() {
		return userName;
	}
	/**
	 * @param userName the userName to set
	 */
	public void setUserName(String userName) {
		this.userName = userName;
	}
	/**
	 * @return the userPassword
	 */
	public String getUserPassword() {
		return userPassword;
	}
	/**
	 * @param userPassword the userPassword to set
	 */
	public void setUserPassword(String userPassword) {
		this.userPassword = userPassword;
	}
	/**
	 * @return the userEmailAddress
	 */
	public String getUserEmailAddress() {
		return userEmailAddress;
	}
	/**
	 * @param userEmailAddress the userEmailAddress to set
	 */
	public void setUserEmailAddress(String userEmailAddress) {
		this.userEmailAddress = userEmailAddress;
	}
	/**
	 * @return the userFirstName
	 */
	public String getUserFirstName() {
		return userFirstName;
	}
	/**
	 * @param userFirstName the userFirstName to set
	 */
	public void setUserFirstName(String userFirstName) {
		this.userFirstName = userFirstName;
	}
	/**
	 * @return the userLastName
	 */
	public String getUserLastName() {
		return userLastName;
	}
	/**
	 * @param userLastName the userLastName to set
	 */
	public void setUserLastName(String userLastName) {
		this.userLastName = userLastName;
	}

	/**
	 * @return the privilege
	 */
	public int getPrivilege() {
		return privilege;
	}

	/**
	 * @param privilege the privilege to set
	 */
	public void setPrivilege(int privilege) {
		this.privilege = privilege;
	}
	/*public String getUserLoggedIn() {
		return userLoggedIn;
	}
	public void setUserLoggedIn(String userLoggedIn) {
		this.userLoggedIn = userLoggedIn;
	}*/
	public Vector<Notification> getUnreadNotif() {
		return unreadNotif;
	}
	public void setUnreadNotif(Vector<Notification> unreadNotif) {
		this.unreadNotif = unreadNotif;
	}
	
	
}
